using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace TCC.Framework
{
    /// <summary>
    /// UI资源标记
    /// </summary>
    public class UIResourceAttribute : Attribute
    {
        public ResLoadMode LoadMode { get; private set; }
        public string ResourcePath { get; private set; }
        public string AssetBundleName { get; private set; }
        public string AssetPath { get; private set; }

        public CanvasType CanvasType;

        public string WorlUIDomain { get; private set; }

        /// <summary>
        /// UI资源标记
        /// </summary>
        /// <param name="resourcePath">资源的Resource路径</param>
        /// <param name="assetBundleName">资源的AB包名字</param>
        /// <param name="assetPath">资源相对路径</param>
        /// <param name="loadMode">加载模式</param>
        /// <param name="canvasType">UI挂载Canvas类型</param>
        /// <param name="worldUIDomain">世界UI作用域</param>
        public UIResourceAttribute(string resourcePath, string assetBundleName, string assetPath,ResLoadMode loadMode,CanvasType canvasType, string worldUIDomain = "")
        {
            LoadMode = loadMode;
            ResourcePath = resourcePath;
            AssetBundleName = assetBundleName;
            AssetPath = assetPath;
            CanvasType = canvasType;
            WorlUIDomain = worldUIDomain;
        }

        public UIResourceAttribute(string resourcePath,CanvasType canvasType=CanvasType.Overlay, string worldUIDomain = "")
        {
            LoadMode = ResLoadMode.Resourece;
            ResourcePath = resourcePath;
            AssetBundleName = "";
            AssetPath = "";
            CanvasType = canvasType;
            WorlUIDomain = worldUIDomain;
        }

        public UIResourceAttribute(string assetBundleName, string assetPath, CanvasType canvasType = CanvasType.Overlay, string worldUIDomain = "")
        {
            LoadMode = ResLoadMode.AssetBundle;
            ResourcePath = "";
            AssetBundleName = assetBundleName;
            AssetPath = assetPath;
            CanvasType = canvasType;
            WorlUIDomain = worldUIDomain;
        }
    }

    public enum CanvasType
    {
        Overlay,
        Camera,
        World
    }
}
